* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  background: #ccc;
}
.wrap {
  position: absolute;
  /* 垂直居中 */
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.wrap p {
  position: absolute;
  top: -30px;
  width: 70px;
  height: 30px;
  text-align: center;
  line-height: 30px;
  color: #fff;
  background: #000;
  font-size: 14px;
  opacity: 0;
  transition: top 0.2s, opacity 0.2s;
}
#checkbox {
  appearance: none;
}
#checkbox:hover ~ p {
  top: -40px;
  opacity: 1;
}
#checkbox::before {
  position: absolute;
  content: "";
  left: 0;
  top: 0;
  width: 60px;
  height: 30px;
  border-radius: 20px;
  background: #757575;
}
#checkbox::after {
  position: absolute;
  content: "弹";
  left: 2px;
  top: 2px;
  text-align: center;
  line-height: 26px;
  width: 26px;
  height: 26px;
  background: #fff;
  border-radius: 50%;
  transition: all cubic-bezier(0.23, 1, 0.32, 1) 0.3s;
}
#checkbox:checked::before {
  background: #00a1d6;
}
#checkbox:checked::after {
  left: 32px;
  color: #00a1d6;
}
